# -*- conding:UTF-8 -*-

'''
@ Project: P8_02_LumenIM-flask
@ File: login_auth.py
@ Author: 罗婷
@ Date：2022/7/10 20:20
强制登录
'''
from functools import wraps

from flask import g

# 强制登录
def login_requir(func):
    @wraps(func)
    def wrap(*args, **kwargs):
        if g.uid:
            return func(*args, **kwargs)
        else:
            return {'message': '请先登录'},401
    return wrap



